<%@page import="entities.SubjectMatter"%>
<%@page import="beans.PersonFacadeLocal"%>
<%@page import="beans.SubjectMatterFacadeLocal"%>
<%@page import="java.util.logging.Level"%>
<%@page import="java.util.logging.Logger"%>
<%@page import="javax.naming.Context"%>
<%@page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.NamingException"%>
<%@page import="javax.ejb.EJB"%>
<%@page import="entities.Person"%>
<%@page import="entities.User"%>
<%@page import="services.PageDetails"%>
<%@page import="components.Button"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Main</title>
        <link rel="stylesheet" href="styles.css" type="text/css" />
        <link rel="stylesheet" type="text/css" href="shadowbox.css">
        <script type="text/javascript" src="js/shadowbox/shadowbox.js"></script>
        <script type="text/javascript">
            Shadowbox.init();
        </script>

        <%
            PageDetails pageDetails = (PageDetails) session.getAttribute("pageDetails");
            User user = (User) session.getAttribute("user");
        %>
    </head>
    <body>
        <%@include file="Components/header.jsp"%>

        <%
            if (user.getRole().getId() != 3) {
        %>
        <%@include file="Components/button-group.jsp"%>
        <%} else {%>
        <%@include file="Components/secretary-button-group.jsp"%>      
        <%}

            if (pageDetails.getButtonPageDisplay().equals("home")) {%>
        <%@include file="Components/home.jsp"%>
        <%} else if (pageDetails.getButtonPageDisplay().equals("homeP")) {%>
        <%@include file="Components/homeP.jsp"%>
        <%} else if (pageDetails.getButtonPageDisplay().equals("homeS")) {%>
        <%@include file="Components/homeS.jsp"%>
        <%} else if (pageDetails.getButtonPageDisplay().equals("changePass")) {%>
        <%@include file="Components/changePass.jsp"%>
        <%} else if (pageDetails.getButtonPageDisplay().equals("classesP")) {%>
        <%@include file="Components/classesP.jsp"%>
        <%} else if (pageDetails.getButtonPageDisplay().equals("grades")) {%>
        <%@include file="Components/grades.jsp"%>
        <%} else if (pageDetails.getButtonPageDisplay().equals("news")) {%>
        <%@include file="Components/news.jsp"%>
        <%} else if (pageDetails.getButtonPageDisplay().equals("exams")) {%>
        <%@include file="Components/exams.jsp"%>
        <%} else if (pageDetails.getButtonPageDisplay().equals("examsP")) {%>
        <%@include file="Components/examsP.jsp"%>
        <%} else if (pageDetails.getButtonPageDisplay().equals("examsS")) {%>
        <%@include file="Components/examsS.jsp"%>
        <%} else if (pageDetails.getButtonPageDisplay().equals("scheduleExam")) {%>
        <%@include file="Components/schedule-exam.jsp"%>
        <%} else {%>
        <%@include file="Components/not-implemented-error.jsp"%>
        <%}
        %>

        <div id="classroomReservation" style="dislpay: none;">
            <div style="color:white" style="dislpay: none;">
                <s:form theme="simple" action="ClassroomReservation">
                    <table>
                        <tr>
                            <td>
                                Classroom
                            </td>
                            <td>
                                <s:select cssClass="hiddenField" cssStyle="hiddenField" name="classroom" list="#session.classroomList" 
                                    listKey="id" listValue="code" headerKey="0" headerValue="-- Please select --"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                <s:submit cssClass="hiddenField" cssStyle="hiddenField" value="Submit"/>
                            </td>
                        </tr>
                    </table>
                </s:form>
            </div>
        </div>

        <script type="text/javascript" src="js/jquery.js"></script>
        <script type="text/javascript" src="js/function/schedule-exam.js"></script>
    </body>
</html>
